﻿@model XXS.Common.Paginate.PaginateBase
@{
    ViewBag.Title = "_paginate";
}
<style>
    .layui-laypage li {
        float:left;
    }
    .layui-laypage-curr a {
        color:white;
        background-color: #0dc316;
    }
</style>
<div class="layui-box layui-laypage layui-laypage-default">
    <ul style="float:left;">
        @if (Model.CurrentPage > 1)
        {
            <li class="first-page">@Html.ActionLink("首页", Model.Action, Model.GetRootValue(1))</li>
            <li class="pre-page">@Html.ActionLink("<上一页", Model.Action, Model.GetRootValue(Model.CurrentPage - 1))</li>
        }
        @for (int i = Model.CurrentPage - 5; i < (Model.CurrentPage + 5); i++)
        {
            if (i < 1 || i > Model.TotalPage) { continue; }

            <li class="@((i == Model.CurrentPage) ? "layui-laypage-curr" : "")">@Html.ActionLink(i.ToString(), Model.Action, Model.GetRootValue(i))</li>
        }
        @if (Model.CurrentPage < Model.TotalPage)
        {

            <li class="next-page">@Html.ActionLink("下一页>", Model.Action, Model.GetRootValue(Model.CurrentPage + 1))</li>
        }

    </ul>

    <span class="layui-laypage-count">共 @Model.TotalPage 页,共 @Model.SourceCount 条</span>

</div>
